package cn.stylefeng.guns.modular.shuheng.state;

public enum QuarterEnum {

    ONE("1",new String[]{"1","2","3"}),
    TWO("2",new String[]{"4","5","6"}),
    THREE("3",new String[]{"7","8","9"}),
    FOUR("4",new String[]{"10","11","12"});

    String name;
    String[] arr;

    QuarterEnum(String name,String[] arr){
        this.name = name;
        this.arr = arr;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String[] getArr() {
        return arr;
    }

    public void setArr(String[] arr) {
        this.arr = arr;
    }

    public static String[]  getArr(String name){
        if(ONE.getName().equals(name)){
            return ONE.getArr();
        }else if(TWO.getName().equals(name)){
            return TWO.getArr();
        }else if(THREE.getName().equals(name)){
            return THREE.getArr();
        }else if(FOUR.getName().equals(name)){
            return FOUR.getArr();
        }
        return null;
    }

    public static String toOption(){
        StringBuffer sb = new StringBuffer();
        sb.append("<option value=''>全年</option>");
        sb.append("<option value='1'>第一季度</option>");
        sb.append("<option value='2'>第二季度</option>");
        sb.append("<option value='3'>第三季度</option>");
        sb.append("<option value='4'>第四季度</option>");
        return sb.toString();
    }
}
